<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://xmlns.jcp.org/jsf/core">
    <h:head>
        <title>Profil</title>
        <h:outputStylesheet library="css" name="styles.css"/> 
    </h:head>
    <h:body>
        <ui:include src="profMenuBar.xhtml"/>
        <h:form enctype="multipart/form-data">
            <p:panel header="#{profBean.prof.ime}  #{profBean.prof.prezime}" styleClass="headerPanel">
                <p:fieldset legend="Podaci" toggleable="true" toggleSpeed="500" collapsed="true">
                    <p:panelGrid columns="2">
                        <p:panelGrid columns="2">
                            <h:outputLabel value="Ime :"/>
                            <p:inputText value="#{profBean.prof.ime}"/>

                            <h:outputLabel value="Prezime :"/>
                            <p:inputText value="#{profBean.prof.prezime}"/>

                            <h:outputLabel value="Kabinet :"/>
                            <p:inputText value="#{profBean.prof.kabinet}"/>

                            <h:outputLabel value="Prijem :"/>
                            <p:inputText value="#{profBean.prof.prijem}"/>

                            <h:outputLabel value="Zvanje :"/>
                            <p:inputText value="#{profBean.prof.zvanje}"/>

                            <h:outputLabel value="Status :"/>
                            <p:inputText value="#{profBean.prof.status}"/>

                            <h:outputLabel value="Telefon :"/>
                            <p:inputText value="#{profBean.prof.ime}"/>

                            <h:outputLabel value="Web :"/>
                            <p:inputText value="#{profBean.prof.web}"/>

                            <h:outputLabel value="Adresa :"/>
                            <p:inputText value="#{profBean.prof.adresa}"/>

                            <h:outputLabel value="E-mail :"/>
                            <p:inputText value="#{profBean.prof.mail}"/>

                            <h:outputLabel value="Istek ugovora :"/>
                            <p:inputText value="#{profBean.prof.istekUgovora}"/>
                            
                            <h:outputLabel value="Slika :"/>
                            <p:fileUpload value="#{profBean.pic}" mode="simple"/> 
                        </p:panelGrid>
                        <p:panel>
                            <h:outputLabel value="CV :"/>
                            <br/>
                            <br/>
                            <p:editor value="#{profBean.prof.cv}" width="600" />
                        </p:panel>

                        <h:outputLabel/>
                        <p:commandButton value="Sacuvaj" action="#{profBean.saveProf()}" ajax="false" style="margin: auto;"/>
                    </p:panelGrid>
                </p:fieldset>
                <br/>
                <p:fieldset legend="Dodaj publikaciju" toggleable="true" toggleSpeed="500" collapsed="true">
                    <p:panelGrid columns="2">
                        <h:outputLabel value="Naziv:"/>
                        <p:inputText value="#{profBean.PNaziv}"/>

                        <h:outputLabel value="Autori:"/>
                        <p:pickList value="#{profBean.ZList}" var="p" itemValue="#{p}" converter="employeeConverter"
                                    showSourceControls="true" showTargetControls="true" showCheckbox="true"  
                                    showSourceFilter="true" showTargetFilter="true" filterMatchMode="contains" effect="bounce" >

                            <f:facet name="sourceCaption">Raspolozivi</f:facet>  
                            <f:facet name="targetCaption">Izabrani</f:facet>  

                            <p:column style="width:75%;">  
                                #{p.ime}  #{p.prezime}
                            </p:column>  

                        </p:pickList>  

                        <h:outputLabel value="Opis:"/>
                        <p:editor value="#{profBean.POpis}" width="600" />

                        <h:outputLabel value="Kategorija:"/>
                        <p:selectOneMenu var="#{profBean.selectedType}"> 
                            <f:selectItem itemLabel="Izaberi jedan..." itemValue="" />  
                            <f:selectItems value="#{profBean.PType}" />  
                        </p:selectOneMenu>
                        <h:outputLabel value="Fajl :"/>
                       
                            <p:fileUpload value="#{profBean.file}" mode="simple"/> 
                        

                        <h:outputLabel value=""/>
                        <p:commandButton value="Sacuvaj" action="#{profBean.savePublication()}" ajax="false"/>
                    </p:panelGrid>
                </p:fieldset>

            </p:panel>
        </h:form>
    </h:body>
</html>

